var login=document.querySelector('button')
var zhanghao=document.querySelector('#zhanghao')
var mima=document.querySelector('#mima')



login.onclick=function(){
    axios.post('/user/login',{zhanghao:zhanghao.value,mima:mima.value}).then((res)=>{
      
        if(res.data.msg=='登录成功'){
            alert('登录成功')
            localStorage.setItem('yonghu',JSON.stringify(res.data.yonghuinfo))
            location.href='/index.html'
        }else{
            alert('用户名或密码错误')
        }
    })
}